package com.zzyl.common.core.page;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * 表格分页数据对象
 * 
 * @author ruoyi
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "表格数据封装类，用于分页查询结果的返回")
@JsonInclude(JsonInclude.Include.NON_NULL) // 忽略值为 null 的字段
public class TableDataInfo<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    /** 总记录数 */
    @ApiModelProperty(value = "总记录数", example = "100", required = true)
    private long total;

    /** 列表数据 */
    @ApiModelProperty(value = "列表数据", required = true)
    private List<T> rows;

    /** 消息状态码 */
    @ApiModelProperty(value = "状态码", example = "200", required = true)
    private int code;

    /** 消息内容 */
    @ApiModelProperty(value = "响应消息", example = "操作成功", required = false)
    private String msg;

}
